﻿using MediatR;
using PublicCommon;
using T_vehicle.Domain;
using T_vehicle.Infrastructure.Impl;
using T_vehicle.Infrastructure.Interfacec;
using T_vehicle.Read.API.Application.Command.MaintenanceCommand;

namespace T_vehicle.Read.API.Application.CommandHandlers.MaintenanceCommandHandlers
{
    public class FanMaintenanceCommandHandlers:IRequestHandler<FanMaintenanceCommand,Maintenance>
    {
        private readonly IMaintenanceRepository maintenanceRepository;

        public FanMaintenanceCommandHandlers(IMaintenanceRepository maintenanceRepository)
        {
            this.maintenanceRepository = maintenanceRepository;
        }

        public   Task<Maintenance> Handle(FanMaintenanceCommand request, CancellationToken cancellationToken)
        {
            var list = maintenanceRepository.GetModelAsync(request.MaintenanceId);
            return list ;
        }
    }
}
